package Year21_Month11.day1108;

import java.util.Stack;

public class CQueue {
    Stack<Integer> a;
    Stack<Integer> b;

    public CQueue() {
        a = new Stack();
        b = new Stack();
    }

    public void appendTail(int value) {
        a.push(value);
    }

    public int deleteHead() {
        if(a.empty() && b.empty()){
            return -1;
        }
        if(b.empty()){
            while(!a.empty()){
                b.push(a.pop());
            }
        }
        return b.pop();
    }
}
